import request from '@/router/axios';

// 获取列表
export const getList = (current,size,params) => {
  return request({
    url: '/api/blade-purchase/adjustinfo/list',
    method: 'get',
    params: {
      current,
      size,
      ...params
    }
  })
}

// 物料列表
export const materialList = (inquiryType,supplierNo,materialNo, materialIdentity) => {
  return request({
    url: '/api/blade-purchase/adjustinfo/materialList',
    method: 'get',
    params: {
      materialNo,
      supplierNo,
      inquiryType,
      materialIdentity
    }
  })
}

// 供应商列表下拉选
export const suppliers = (supplierNo) => {
  return request({
    url: '/api/blade-purchase/adjustinfo/suppliers',
    method: 'get',
    params: {
      supplierNo
    }
  })
}

// 物料列表下拉选
export const materials = (materialNo) => {
  return request({
    url: '/api/blade-purchase/adjustinfo/materials',
    method: 'get',
    params: {
      materialNo
    }
  })
}

// 保存
export const saveFn = (data) => {
  return request({
    url: '/api/blade-purchase/adjustinfo/save',
    method: 'post',
    data
  })
}

// 逻辑删除
export const remove = (ids) => {
  return request({
    url: '/api/blade-purchase/adjustinfo/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

//提交
export const submitApproval = (id) => {
  return request({
    url: '/api/blade-purchase/adjustinfo/start-process',
    method: 'get',
    params: {
      id
    }
  })
}

// 详情
export const detail = (id) => {
  return request({
    url: '/api/blade-purchase/adjustinfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}
